/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Validations;

import Services.exception.ServiceException;
import Services.ProviderServices;
import beans.ProviderBean;

/**
 *
 * @author Anthar
 */
public class ProviderValidation {

    private ProviderServices providerService;

    public ProviderValidation(){
        providerService = new ProviderServices();
    }
     
  public boolean existProvider(String RFC) throws ServiceException{
            final ProviderBean provider = getProviderService().searchProvider(RFC);
            if (provider != null) {
                return true;
            }
            return false;
   }

    /**
     * @return the providerService
     */
    public ProviderServices getProviderService() {
        return providerService;
    }

    /**
     * @param providerService the providerService to set
     */
    public void setProviderService(ProviderServices providerService) {
        this.providerService = providerService;
    }




}
